home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 8 / FM Towns Free Software Collection 8.iso / t_os / igo / gosource / mddesk.c < prev    next >
C/C++ Source or Header  |  1994-06-01  |  3KB  |  125 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <winb.h>
  5. #include <te.h>
  6. #include <fntb.h>
  7. #include <gui.h>
  8. #include "igo.h"
  9. #include "banx.h"
  10. #include "kiffile.h"
  11. #include "title.h"
  12.  
  13. /*    使用する部品の宣言        */
  14. extern int    fsavedialogId;
  15. extern int    fsave_messageId[2];
  16.  
  17. /*    About画面の変数の定義                */
  18.  
  19. int    alertId = -1 ;
  20. int    aboutMesId[2] = -1 ;
  21. int    aboutBtnId = -1 ;
  22.  
  23. /*    背景画面の変数の定義    */
  24.  
  25. int    backId = -1 ;
  26. int    buttonId = -1 ;
  27. int    deskTopId = -1 ;
  28. int    deskTopBtnId[2] = -1 ;
  29. int    menuBarId = -1 ;
  30. int    mitemBarId[4] = -1 ;
  31. int    menu0Id = -1 ;
  32. int    mitem0Id = -1 ;
  33. int    menu1Id = -1 ;
  34. int    mitem1Id[7] = -1 ;
  35. int    menu2Id = -1 ;
  36. int    mitem2Id[13] = -1 ;
  37. int    menu3Id = -1 ;
  38. int    title_dispdialogId = -1 ;
  39. int    title_messageId[12] = -1 ;
  40. int    textcommentId[10] = -1 ;
  41. int about_messageId = -1 ;
  42.  
  43. /*    initDataMIDESK:mitem0Id:MJ_MITEML40の呼び出し関数    */
  44. /*    Aboutを表示するための関数                            */
  45. int    showAboutFunc(kobj, messId, argc, pev, trigger)
  46. int        kobj ;
  47. int        messId ;
  48. int        argc ;
  49. EVENT    *pev ;
  50. int        trigger ;
  51. {
  52. int physicalMax;
  53. int    logicalMax;
  54. int    maxMemory;
  55. static char string[80];
  56.  
  57.     physicalMax = TL_checkMemory(0);
  58.     logicalMax = TL_checkMemory(2);
  59.     maxMemory = (( physicalMax <logicalMax ) ? physicalMax : logicalMax )*4;
  60.  
  61.     sprintf( string, "残りメモリは%5dKバイトです", maxMemory );
  62.     MMI_SendMessage( about_messageId , MM_SETMSG , 1, string);
  63.  
  64.     /*    オブジェクトをダイアログに取り付ける    */
  65.     MMI_SendMessage( alertId , MM_ATTACH , 1 , backId ) ;
  66.  
  67.     /*    alertIdで示されるオブジェクトを表示する    */
  68.     MMI_SendMessage( alertId , MM_SHOW , 0 ) ; 
  69.  
  70.     return NOERR ;
  71. }
  72.  
  73. /*    initDataMIABOU:aboutBtnId:MJ_DBUTTONL40の呼び出し関数    */
  74. /*    Aboutを消去するための関数                                */
  75. int    eraseAboutFunc(kobj, messId, argc, pev, trigger)
  76. int        kobj ;
  77. int        messId ;
  78. int        argc ;
  79. EVENT    *pev ;
  80. int        trigger ;
  81. {
  82.     /*    alertIdで示されるオブジェクトを消す        */
  83.     MMI_SendMessage( alertId , MM_ERASE , 0 ) ;
  84.  
  85.     /*    オブジェクトをダイアログから取り外す    */
  86.     MMI_SendMessage( alertId , MM_DETACH , 0 ) ;
  87.  
  88.     return NOERR ;
  89. }
  90.  
  91. /*    initDataMIDESK:deskTopBtnId[1]:MJ_ICONL40の呼び出し関数    */
  92. /*    initDataMIDESK:mitem1Id[4]:MJ_MITEML40の呼び出し関数    */
  93. int    exitFunc(kobj, messId, argc, pev, trigger)
  94. int        kobj ;
  95. int        messId ;
  96. int        argc ;
  97. EVENT    *pev ;
  98. int        trigger ;
  99. {
  100.     if(title_fsave_read()==ON){
  101.         title_state_set(QUIT);
  102.  
  103.         MMI_SendMessage( fsave_messageId[0], MM_SETMSG, 1, 
  104.                     "棋譜デ-タが保存されておりません");
  105.         MMI_SendMessage( fsave_messageId[1], MM_SETMSG, 1, 
  106.                     "デ-タを保存して終了を行いますか");
  107.  
  108.         /*    オブジェクトをダイアログに取り付ける    */
  109.         MMI_SendMessage( fsavedialogId , MM_ATTACH , 1 , backId ) ;
  110.  
  111.         /*    dialogId_handyでされるオブジェクトを表示する    */
  112.         MMI_SendMessage( fsavedialogId , MM_SHOW , 0 ) ; 
  113.  
  114.         /*    オブジェクトをダイアログから取り外す    */
  115.         MMI_SendMessage( deskTopId , MM_DETACH , 0 ) ;
  116.         MMI_SendMessage( buttonId , MM_DETACH , 0 ) ;
  117.  
  118.     }else{
  119.         MMI_SetHaltFlag( TRUE ) ;
  120.     }
  121.  
  122.     return NOERR ;
  123. }
  124.  
  125.